package com.luhuiguo.cms.shared.event;

import com.google.gwt.event.shared.GwtEvent;
import com.luhuiguo.cms.shared.model.ArticleModel;

public class ArticleCreatedEvent extends GwtEvent<ArticleCreatedEventHandler> {

    public static Type<ArticleCreatedEventHandler> TYPE = new Type<ArticleCreatedEventHandler>();

    private final ArticleModel ArticleModel;

    public ArticleCreatedEvent(ArticleModel ArticleModel) {
        this.ArticleModel = ArticleModel;

    }

    public ArticleModel getArticle() {
        return ArticleModel;
    }

    @Override
    public Type<ArticleCreatedEventHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(ArticleCreatedEventHandler handler) {
        handler.onArticleCreated(this);
    }
}
